#ifndef COMMON_H
#define COMMON_H

#include <stdio.h>
#include <stdlib.h>

#include "cutil_math.h"

#define G 6.67384e-11f
#define EPS 1e-6f // minimum distance squared

void inputError();
void mallocError();
void cudaMallocError();

void* safe_malloc(size_t size);
void* safe_realloc(void* ptr, size_t size);
void* safe_cudaMalloc(size_t size);
void* safe_cudaMallocHost(size_t size);

unsigned int msb32(register unsigned int x);

#endif
